public class ReverseCommand implements Command {

    private final Genome genome;
    private final int genomeIdx;
    private final int startBlock;
    private final int endBlock;

    public ReverseCommand(int genomeIdx, Genome genome, int startBlock, int endBlock) {
        this.genomeIdx = genomeIdx;
        this.genome = genome;
        this.startBlock = startBlock;
        this.endBlock = endBlock;
    }

    @Override
    public void undo() throws ParametersException {
        genome.reverse(startBlock, endBlock);
    }

    @Override
    public void execute() throws ParametersException {
        genome.reverse(startBlock, endBlock);
    }

    @Override
    public String toString() {
        return "reverse " + genomeIdx+" "+startBlock + " " + endBlock;
    }
}
